<template>
    <view id="typeBox">
        <view class="leftNavBox">
            <leftNav :pageKey="leftNavData"></leftNav>
        </view>
        <view class="rightBox">
            <rightNav></rightNav>
        </view>
        <car></car>
    </view>
</template>

<script>
    import leftNav from '../../until/com/leftNav'
    import rightNav from '../../until/com/rightNav'
    import * as url from '../../until/api'
    import car from '../../until/com/car'

    export default {
        name: "type",
        components:{
            leftNav,
            rightNav,
            car,
        },
        data(){
            return{
                banner:[],
                leftNavData:'leftNavData'
            }
        },
        methods:{

        },
        mounted() {
            const _this = this
        },
        created(){
            uni.request({ //发起请求，获取左侧导航栏数据
                url:url.getAllClass,
                method:'POST',
                success:resp=>{
                    uni.setStorage({
                        key: 'leftNavData',
                        data:resp.data.data,
                        success: function () {
                            //console.log('success');
                        }
                    })
                }
            })
            uni.request({  //发起请求，获取右侧导航栏数据
                url: url.getImg,
                method:'POST',
                success:function (res){
                    // console.log(res.data)
                    uni.setStorage({
                        key: 'right',
                        data:res.data
                    })
                }
            })
        },
    }
</script>

<style scoped>
    body{
        width: 10rpx;
        height: 10rpx;
        font-size: 16rpx;
    }
    #typeBox{
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }
    .leftNavBox{
        width: 30%;
        height: 34.5rem;
        overflow: hidden;
    }
    .rightBox{
        width: 70%;
    }
</style>